#ifndef REGION_EFFECT_H_
#define REGION_EFFECT_H_

//@Include: puzzle_effect.h

// INCLUDES //
#include "object.h"
//////////////

class Object;

/**
* The owner of the region effect. Provides callbacks.
* 
* @see RegionEffect
* @author dfoelber
**/
class RegionEffectOwner
{
public:
	/**
	* Virtual destructor
	**/
	virtual ~RegionEffectOwner() {}
	
	/**
	* Notifies the owner that the effect is finished.
	**/
	virtual void EffectDone() = 0;
	
	/**
	* Gets the list of objects in the region.
	* 
	* @region Objects currently in the region
	**/
	virtual vector<Object*>& GetObjects() = 0;
	
	/**
	* Checks if the object passed is the active object or in the active object's association list.
	* 
	* @param object The object to check
	* @return If the object is the active object or in the active object's association list
	**/
	virtual bool IsObjectActiveOrSimilar(Object* object) = 0;
	
	/**
	* Removes the given object from the region.
	* 
	* @param object The object to remove
	* @param del If the object should be deleted
	**/
	virtual void RemoveObject(Object* object, bool del = true) = 0;
	
	/**
	* Gets the object, if any, that correspond to the X,Y coordinates.
	* 
	* @param x The X coordinate
	* @param y The Y coordinate
	* @return The associated object, or null if none correspond
	**/
	virtual Object* GetObjectByCoordinate(int x, int y) = 0;
	
	/**
	* Performs a translation on the given object.
	* 
	* @param object The object to move
	* @param x The X distance to move
	* @param y The Y distance to move
	**/
	virtual void TranslateObject(Object* object, int x, int y) = 0;
};

/**
* An effect that is used on a region.
* 
* @see RegionEffectOwner
* @author dfoelber
**/
class RegionEffect
{
public:
	/**
	* Constructor
	* 
	* @param owner The owner to this effect
	**/
	RegionEffect(RegionEffectOwner* owner)
	{
		this->owner = owner;
	}
	
	/**
	* Destructor
	**/
	virtual ~RegionEffect() {}
	
	/**
	* Gets the current owner of the effect.
	* 
	* @return The current owner
	**/
	RegionEffectOwner* GetOwner()
	{
		return owner;
	}
	
	/**
	* Asks the effect if it wants to freeze the active object and its association list.
	* 
	* @return If the active object and association are to be frozen
	**/
	virtual bool FreezeActiveAndSimilar() = 0;
	
	/**
	* Notifies the effect to start.
	**/
	virtual void OnStart() = 0;
	
	/**
	* Input that can be used by the effect.
	* 
	* @param event The event
	* @return If the event was consumed
	**/
	virtual bool Input( SDL_Event event ) = 0;
	
private:
	/// The owner of the effect.
	RegionEffectOwner*	owner;
};

#endif /*REGION_EFFECT_H_*/
